{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from xgboost import XGBClassifier\n",
    "import xgboost as xgb\n",
    "\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "#from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.model_selection import StratifiedKFold\n",
    "\n",
    "from sklearn.metrics import log_loss\n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# path to where the data lies\n",
    "dpath = './data/'\n",
    "dtrain = xgb.DMatrix(dpath +\"RentListingInquries_FE_train.bin\")\n",
    "dtest = xgb.DMatrix(dpath +\"RentListingInquries_FE_test.bin\")\n",
    "#train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "#直接调用xgboost内嵌的交叉验证（cv），可对连续的n_estimators参数进行快速交叉验证\n",
    "#而GridSearchCV只能对有限个参数进行交叉验证\n",
    "def modelfit(alg, dtrain, cv_folds=5, early_stopping_rounds=10):\n",
    "    xgb_param = alg.get_xgb_params()\n",
    "    xgb_param['num_class'] = 3\n",
    "    xgb_param['nthread'] = 4\n",
    "    #直接调用xgboost，而非sklarn的wrapper类\n",
    "    xgtrain = dtrain\n",
    "    cvresult = xgb.cv(xgb_param, xgtrain, num_boost_round=alg.get_params()['n_estimators'], folds =cv_folds,\n",
    "             metrics='mlogloss', early_stopping_rounds=early_stopping_rounds)     \n",
    "    #cvresult.to_csv('1_nestimators.csv', index_label = 'n_estimators')\n",
    "    print (\"logloss of train :\" )\n",
    "    train_mean = cvresult['train-mlogloss-mean'].iloc[-1]\n",
    "    #train_stds = cvresult['train-mlogloss-std'] \n",
    "    print(train_mean)   \n",
    "    return train_mean\n",
    "    #最佳参数n_estimators\n",
    "    #n_estimators = cvresult.shape[0]\n",
    "    \n",
    "    # 采用交叉验证得到的最佳参数n_estimators，训练模型\n",
    "    #alg.set_params(n_estimators = n_estimators)\n",
    "    #bst = xgb.train(xgb_param, dtrain, n_estimators)\n",
    "    #alg.fit(X_train, y_train, eval_metric='mlogloss')\n",
    "        \n",
    "    #Predict training set:\n",
    "    #train_predprob = alg.predict_proba(X_train)\n",
    "    #logloss = log_loss(y_train, train_predprob)\n",
    "\n",
    "   #Print model report:\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.5485760000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5485760000000001}\n",
      "logloss of train :\n",
      "0.534677\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.534677}\n",
      "logloss of train :\n",
      "0.5348353333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5348353333333334}\n",
      "logloss of train :\n",
      "0.4713986666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4713986666666667}\n",
      "logloss of train :\n",
      "0.49371366666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.49371366666666666}\n",
      "logloss of train :\n",
      "0.4839263333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4839263333333333}\n",
      "logloss of train :\n",
      "0.4448716666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4448716666666666}\n",
      "logloss of train :\n",
      "0.45919266666666675\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45919266666666675}\n",
      "logloss of train :\n",
      "0.473656\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.473656}\n",
      "logloss of train :\n",
      "0.40068733333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.40068733333333334}\n",
      "logloss of train :\n",
      "0.41724766666666663\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.41724766666666663}\n",
      "logloss of train :\n",
      "0.4381633333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4381633333333333}\n",
      "logloss of train :\n",
      "0.5330223333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5330223333333334}\n",
      "logloss of train :\n",
      "0.553308\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.553308}\n",
      "logloss of train :\n",
      "0.5379349999999999\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5379349999999999}\n",
      "logloss of train :\n",
      "0.4929266666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4929266666666667}\n",
      "logloss of train :\n",
      "0.492901\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.492901}\n",
      "logloss of train :\n",
      "0.490321\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.490321}\n",
      "logloss of train :\n",
      "0.45575066666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45575066666666664}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.45653533333333335\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45653533333333335}\n",
      "logloss of train :\n",
      "0.46465566666666663\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.46465566666666663}\n",
      "logloss of train :\n",
      "0.39748\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.39748}\n",
      "logloss of train :\n",
      "0.4249773333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4249773333333333}\n",
      "logloss of train :\n",
      "0.4300333333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4300333333333333}\n",
      "logloss of train :\n",
      "0.5372520000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5372520000000001}\n",
      "logloss of train :\n",
      "0.538526\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.538526}\n",
      "logloss of train :\n",
      "0.538953\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.538953}\n",
      "logloss of train :\n",
      "0.49042433333333335\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.49042433333333335}\n",
      "logloss of train :\n",
      "0.5000736666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5000736666666666}\n",
      "logloss of train :\n",
      "0.5039866666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5039866666666666}\n",
      "logloss of train :\n",
      "0.46331066666666665\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.46331066666666665}\n",
      "logloss of train :\n",
      "0.453773\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.453773}\n",
      "logloss of train :\n",
      "0.457872\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.457872}\n",
      "logloss of train :\n",
      "0.40860699999999994\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.40860699999999994}\n",
      "logloss of train :\n",
      "0.42366366666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.42366366666666666}\n",
      "logloss of train :\n",
      "0.43761333333333335\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 0.5, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.43761333333333335}\n",
      "logloss of train :\n",
      "0.5494880000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5494880000000001}\n",
      "logloss of train :\n",
      "0.5351656666666668\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5351656666666668}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.5354523333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5354523333333333}\n",
      "logloss of train :\n",
      "0.492699\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.492699}\n",
      "logloss of train :\n",
      "0.48728466666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.48728466666666664}\n",
      "logloss of train :\n",
      "0.4898179999999999\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4898179999999999}\n",
      "logloss of train :\n",
      "0.45254700000000003\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45254700000000003}\n",
      "logloss of train :\n",
      "0.46492700000000003\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.46492700000000003}\n",
      "logloss of train :\n",
      "0.47579\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.47579}\n",
      "logloss of train :\n",
      "0.39037533333333335\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.39037533333333335}\n",
      "logloss of train :\n",
      "0.41443366666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.41443366666666664}\n",
      "logloss of train :\n",
      "0.435362\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.435362}\n",
      "logloss of train :\n",
      "0.533796\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.533796}\n",
      "logloss of train :\n",
      "0.5373643333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5373643333333334}\n",
      "logloss of train :\n",
      "0.5535953333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5535953333333333}\n",
      "logloss of train :\n",
      "0.482859\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.482859}\n",
      "logloss of train :\n",
      "0.49056833333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.49056833333333333}\n",
      "logloss of train :\n",
      "0.49157699999999993\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.49157699999999993}\n",
      "logloss of train :\n",
      "0.45602366666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45602366666666666}\n",
      "logloss of train :\n",
      "0.45972833333333335\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45972833333333335}\n",
      "logloss of train :\n",
      "0.45452633333333337\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45452633333333337}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.4014246666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4014246666666667}\n",
      "logloss of train :\n",
      "0.4250096666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4250096666666667}\n",
      "logloss of train :\n",
      "0.4386583333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4386583333333334}\n",
      "logloss of train :\n",
      "0.537951\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.537951}\n",
      "logloss of train :\n",
      "0.5386176666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5386176666666667}\n",
      "logloss of train :\n",
      "0.5415706666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5415706666666666}\n",
      "logloss of train :\n",
      "0.5036996666666665\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5036996666666665}\n",
      "logloss of train :\n",
      "0.5041080000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5041080000000001}\n",
      "logloss of train :\n",
      "0.504721\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.504721}\n",
      "logloss of train :\n",
      "0.4515363333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4515363333333333}\n",
      "logloss of train :\n",
      "0.47547933333333336\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.47547933333333336}\n",
      "logloss of train :\n",
      "0.4631813333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4631813333333333}\n",
      "logloss of train :\n",
      "0.41670199999999996\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.41670199999999996}\n",
      "logloss of train :\n",
      "0.43595266666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.43595266666666666}\n",
      "logloss of train :\n",
      "0.44077633333333327\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.44077633333333327}\n",
      "logloss of train :\n",
      "0.5355126666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5355126666666666}\n",
      "logloss of train :\n",
      "0.5367133333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5367133333333333}\n",
      "logloss of train :\n",
      "0.5351443333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5351443333333333}\n",
      "logloss of train :\n",
      "0.491245\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.491245}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.4810046666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4810046666666666}\n",
      "logloss of train :\n",
      "0.488278\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.488278}\n",
      "logloss of train :\n",
      "0.4571326666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4571326666666667}\n",
      "logloss of train :\n",
      "0.4686113333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4686113333333333}\n",
      "logloss of train :\n",
      "0.475404\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.475404}\n",
      "logloss of train :\n",
      "0.39591\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.39591}\n",
      "logloss of train :\n",
      "0.42286166666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.42286166666666664}\n",
      "logloss of train :\n",
      "0.4314896666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4314896666666667}\n",
      "logloss of train :\n",
      "0.5363506666666668\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5363506666666668}\n",
      "logloss of train :\n",
      "0.5390990000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5390990000000001}\n",
      "logloss of train :\n",
      "0.5465803333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5465803333333333}\n",
      "logloss of train :\n",
      "0.49277699999999997\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.49277699999999997}\n",
      "logloss of train :\n",
      "0.4842686666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4842686666666667}\n",
      "logloss of train :\n",
      "0.4887926666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4887926666666667}\n",
      "logloss of train :\n",
      "0.45669866666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45669866666666664}\n",
      "logloss of train :\n",
      "0.45555133333333336\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.45555133333333336}\n",
      "logloss of train :\n",
      "0.4663996666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4663996666666667}\n",
      "logloss of train :\n",
      "0.41125266666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.41125266666666666}\n",
      "logloss of train :\n",
      "0.4207686666666666\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4207686666666666}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of train :\n",
      "0.42993466666666663\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 1, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.42993466666666663}\n",
      "logloss of train :\n",
      "0.5394303333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5394303333333333}\n",
      "logloss of train :\n",
      "0.5395576666666667\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5395576666666667}\n",
      "logloss of train :\n",
      "0.5404070000000001\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 3, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.5404070000000001}\n",
      "logloss of train :\n",
      "0.48476400000000003\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.48476400000000003}\n",
      "logloss of train :\n",
      "0.503954\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.503954}\n",
      "logloss of train :\n",
      "0.4999263333333333\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 5, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.4999263333333333}\n",
      "logloss of train :\n",
      "0.457778\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.457778}\n",
      "logloss of train :\n",
      "0.46688166666666664\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.46688166666666664}\n",
      "logloss of train :\n",
      "0.464497\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 7, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.464497}\n",
      "logloss of train :\n",
      "0.426162\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.426162}\n",
      "logloss of train :\n",
      "0.43609733333333334\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 3, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.43609733333333334}\n",
      "logloss of train :\n",
      "0.44533599999999995\n",
      "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 5, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 2, 'reg_lambda': 2, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.44533599999999995}\n"
     ]
    }
   ],
   "source": [
    "#params = {\"objective\": \"multi:softprob\", \"eval_metric\":\"mlogloss\", \"num_class\": 9}\n",
    "max_depth = range(3,10,2)\n",
    "min_child_weight = range(1,6,2)\n",
    "reg_alpha = [ 0.1, 1, 2]    \n",
    "reg_lambda = [0.5, 1, 2]\n",
    "for k in reg_lambda:\n",
    "    for l in reg_alpha:\n",
    "        for i in max_depth:\n",
    "            for j in min_child_weight:\n",
    "                xgb1 = XGBClassifier(\n",
    "                    learning_rate =0.1,  #数值大没关系，cv会自动返回合适的n_estimators\n",
    "                    n_estimators=1000,\n",
    "                    gamma=0,\n",
    "                    subsample=0.3,\n",
    "                    colsample_bytree=0.8,\n",
    "                    colsample_bylevel=0.7,\n",
    "                    objective= 'multi:softmax',\n",
    "                    seed=3)\n",
    "                xgb1.set_params(max_depth =i)\n",
    "                xgb1.set_params(min_child_weight=j)\n",
    "                xgb1.set_params(reg_alpha=l)\n",
    "                xgb1.set_params(reg_lambda=k)\n",
    "                tmp0=modelfit(xgb1, dtrain)\n",
    "                tmp=xgb1.get_xgb_params()\n",
    "                tmp['logloss'] = tmp0\n",
    "                print(tmp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "logloss of train :\n",
    "0.39037533333333335\n",
    "{'base_score': 0.5, 'booster': 'gbtree', 'colsample_bylevel': 0.7, 'colsample_bytree': 0.8, 'gamma': 0, 'learning_rate': 0.1, 'max_delta_step': 0, 'max_depth': 9, 'min_child_weight': 1, 'missing': None, 'n_estimators': 1000, 'nthread': 1, 'objective': 'multi:softmax', 'reg_alpha': 0.1, 'reg_lambda': 1, 'scale_pos_weight': 1, 'seed': 3, 'silent': 1, 'subsample': 0.3, 'logloss': 0.39037533333333335}"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
